import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import '../../helper/dioHelper.dart';

class JinQiDiaoDuPage extends StatefulWidget {
  @override
  @override
  createState() => new JinQiDiaoDuPageState();
}

class JinQiDiaoDuPageState extends State<JinQiDiaoDuPage> {
//  定义底部导航列表
  String jinqi = "";
  bool ifLoaded = false;

  void loadData() async {
    var s1 = await DioHelper.Get("/BaoBiao/JinQi", {});

    print(s1);
    if (s1.statusCode == 200) {
      jinqi = s1.data.toString();
      jinqi = jinqi.replaceAll("\r\n", "\r\n\r\n");
      setState(() {
        ifLoaded = true;
      });
    }
  }

  int currentIndex = 0; //当前索引
  Widget? currentPage; //当前页面

  @override
  void initState() {
    super.initState();
    loadData();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Scaffold(
      appBar: new AppBar(
        // title: bottomTabs[currentIndex].title,
        title: Text("近期调度"),
        // leading: Icon(Icons.menu),
      ),
      body: ifLoaded
          ? SingleChildScrollView(
              child: Container(
                  margin: EdgeInsets.all(8.0),
                  child: Text(
                    jinqi,
                    style: TextStyle(
                        fontSize: 16.0, letterSpacing: 1.5, height: 1.8),
                  )))
          : Center(
              child: SpinKitCircle(
              color: Colors.blue,
            )),
    );
  }
}
